import { createApp, App } from 'vue'
import rootApp from './App.vue'
import router from './router'
import store from './store'

import { initStore } from './store'
// 使用normalize.css重置
import 'normalize.css'
// 使用自己的css
import './assets/css/index.less'

import { registerApp } from './global'
import { globalProperties } from './global/global-properties'

// app有对应的类型App
const app: App = createApp(rootApp)
app.use(store)
// 刷新时先初始化vuex的state和将路由进行动态注册
initStore()
// 之后进行路由匹配
app.use(router)

// 插件的二种写法 函数(app: App){}/ { install(app: App){} }
// 注册全局element-plus的图标
registerApp(app)
// 注册全局的属性 app.config.globalProperties.XXX
app.use(globalProperties)

app.mount('#app')

// 环境变量(设置.env文件中)
// VUE_APP_XXX = one
// VUE_APP_BASE_URL = https://Fhup.org/develop
// console.log(process.env.VUE_APP_XXX)
// console.log(process.env.VUE_APP_BASE_URL)
